<?php

/**
 * MatchType filter form base class.
 *
 * @package    symfony
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseMatchTypeFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'coefficient' => new sfWidgetFormFilterInput(),
      'title'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'type'        => new sfWidgetFormChoice(array('choices' => array('' => '', 'team' => 'team', 'individual' => 'individual'))),
    ));

    $this->setValidators(array(
      'coefficient' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'title'       => new sfValidatorPass(array('required' => false)),
      'type'        => new sfValidatorChoice(array('required' => false, 'choices' => array('team' => 'team', 'individual' => 'individual'))),
    ));

    $this->widgetSchema->setNameFormat('match_type_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'MatchType';
  }

  public function getFields()
  {
    return array(
      'id'          => 'Number',
      'coefficient' => 'Number',
      'title'       => 'Text',
      'type'        => 'Enum',
    );
  }
}
